const { merge } = require("webpack-merge");
const commonConfig = require("./webpack.common.js");

const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");

module.exports = merge(commonConfig, {
  mode: "production",
  plugins: [
    new CleanWebpackPlugin(),
    new CopyWebpackPlugin({
      patterns: [
        {
          context: "public",
          from: "*.ico",
          to: path.join(__dirname, "dist"),
        },
      ],
    }),
  ],
});
